<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/4/19
 * Time: 11:31
 */
namespace Home\Model;
use Think\Model;
use User\Api\UserApi;
class OrderModel extends Model
{
    /**
     * @param null $staus判断是月份还是年份
     * @param array $data 要提交的数据（数组类型）
     */
    public function insertData($status = null,array $data)
    {
        if(is_null($status))
        {
            return false;
        }
        return $this->add($data);
    }

    /**
     * 根据会员id查询订单详情
     * @param null $userid 会员id
     * @return bool|mixed
     */
    public function selectById($userid = null)
    {
        if(is_null($userid))
        {
            return false;
        }
       return $this->where("user_id = {$userid}")->select();
    }
}